package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Travel;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.query.SearchQueryObject;
import cn.wolfcode.trip.base.query.TravelQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TravelMapper {

    int deleteByPrimaryKey(Long id);

    int insert(Travel record);

    Travel selectByPrimaryKey(Long id);

    List<Travel> selectAll();

    int updateByPrimaryKey(Travel record);

    List<Travel> queryForList(TravelQueryObject qo);

    void updateState(Travel travel);

    List<Travel> listForTravel(Long userId);

    int getByTravelId(@Param("userId") Long userId, @Param("travelId") Long travelId);

    void addCollection(@Param("userId") Long userId, @Param("travelId") Long travelId);

    void deleteCollection(@Param("userId") Long userId, @Param("travelId") Long travelId);

    int selectCollectionNumByTravelId(Long travelId);//通过游记id查询人数

    List<Travel> query(SearchQueryObject qo);

    int queryForCount(SearchQueryObject qo);

    int CountForTravel(Long authorId);
    int queryLikeCountByTravelId(Long travelId);

    int queryIsLike(@Param("userId") Long userId, @Param("travelId") Long travelId);

    void updateBrowseNumById(Long id);

    List<Travel> ListForUserId(QueryObject qo);

    Long selectAuthorIdBytravelId(Long travelId);



}